{extend name="base" /}
{block name="body"}
<div class="layui-card">
    <div class="layui-card-body">
		<table class="layui-table layui-form">
			<thead>
				<tr>
                                        <th>日期</th>
					<th>客户名称</th>
					<th>手机号码</th>
					<th>订单金额</th>
					<th>订单信息</th>
                                        {foreach name="config" item="c"}
                                        <th>{$c.title}</th>
                                        {/foreach}
                                        <th>操作人</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				{foreach name="list" item="v" empty="$empty"}
                                <?php $customer = \app\common\model\Customer::get($v['cid']);?>
				<tr>
					<td>{$v.create_time}</td>
                                        <td>{$customer.cname}</td>
					<td>{$customer.mobile}</td>
                                        <td>￥{$v.total}元</td>
                                        <td>{$v.remark}</td>
                                        {foreach name="config" item="c"}
                                        <td>{if isset($v.jdata[$c.name])}{$v.jdata[$c.name]}{/if}</td>
                                        {/foreach}
                                        <td>{:get_user_realname($v['uid'])}</td>
					<td>
                                            <a href="{:url('user/order/edit', ['id' => $v.id])}" class="layui-btn layui-btn-xs layui-btn-normal"><i class="fa fa-edit"></i> 编辑</a>
                                            <a href="{:url('user/order/del', ['id' => $v.id])}" class="layui-btn layui-btn-xs layui-btn-danger ajax-delete"><i class="fa fa-trash-o"></i> 删除</a>
					</td>
				</tr>
				{/foreach}
			</tbody>
		</table>
		<div class="page">{$list->render()}</div>
	</div>
</div>
{/block}